@charset "UTF-8";
@import url('https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.6.2/cropper.min.css');

/* ANCORAGEM BASE */
.container-profile {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.profile-trigger {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    outline: none;
}

/* GATILHO DA NAVBAR (Responsivo por padrão com limites) */
.profile-trigger img {
    width: 8vw;
    max-width: 40px;
    min-width: 32px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: border-color 0.2s ease;
}

.profile-trigger:hover img {
    border-color: #d11313;
}

/* DROPDOWN FLUTUANTE ADAPTÁVEL */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 160px;
    padding: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    align-items: center;
    
    /* Estados de transição */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.profile-dropdown.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Seta indicadora ajustada para não quebrar em telas finas */
.profile-dropdown::before {
    content: '';
    position: absolute;
    top: -5px;
    right: 14px;
    width: 10px;
    height: 10px;
    background: #1e1e24;
    transform: rotate(45deg);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

/* CONTAINER DA FOTO INTERNA DO MENU */
.avatar-edit-wrapper {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #d11313;
    background: #0f0f12;
}

.avatar-edit-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avatar-edit-wrapper:hover .avatar-overlay {
    opacity: 1;
}

.avatar-overlay span {
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-info > span {
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* BOTÃO REMOVER FOTO (Ajustado para toque mobile) */
.btn-delete-avatar {
    background: transparent;
    border: none;
    color: #ff4d4d;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    width: 100%;
    transition: background 0.2s ease;
}

.btn-delete-avatar:hover {
    background: rgba(255, 77, 77, 0.1);
}

.profile-divider {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

/* LINK LOGOUT */
.logout-link {
    color: #b0b0b5;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    width: 100%;
    text-align: center;
    padding: 8px 0;
    border-radius: 6px;
    transition: background 0.2s ease, color 0.2s ease;
}

.logout-link:hover {
    background: #d11313;
    color: #ffffff;
}

/* ==========================================================================
   MODAL DE EDIÇÃO AVANÇADO E RESPONSIVO (WHATSAPP STYLE)
   ========================================================================== */
.tg-crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 12, 0.9);
    z-index: 10005;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 16px; /* Margem de segurança para telas pequenas */
}

.tg-crop-modal.active {
    display: flex;
}

.tg-crop-card {
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 100%;
    max-width: 420px; /* Limite confortável para Desktop */
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.tg-crop-card h3 {
    color: #ffffff;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    margin: 0;
}

/* CONTAINER DO PREVIEW DE CORTE DO CROPPER */
.tg-crop-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Força quadrado perfeito em qualquer dispositivo */
    background: #0f0f12;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.tg-crop-wrapper img {
    max-width: 100%;
    display: block;
}

/* BOTÕES DO MODAL */
.tg-crop-footer {
    display: flex;
    gap: 12px;
    width: 100%;
}

.tg-crop-btn {
    flex: 1;
    padding: 14px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: background 0.2s ease;
}

.tg-crop-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.tg-crop-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tg-crop-btn-confirm {
    background: #d11313;
    color: #ffffff;
}

.tg-crop-btn-confirm:hover {
    background: #f01717;
}

/* Customização arredondada do Cropper.js */
.cropper-view-box,
.cropper-face {
    border-radius: 50%;
    outline: 2px solid #d11313;
}

/* ==========================================================================
   MEDIA QUERIES - REGRAS ADAPTATIVAS DE RESOLUÇÃO
   ========================================================================== */
@media (min-width: 700px) {
    .profile-trigger img {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 360px) {
    .tg-crop-card {
        padding: 16px;
    }
    .tg-crop-btn {
        padding: 12px;
        font-size: 0.8rem;
    }
}